<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>	自定义函数 参数两个：数组，实现找差集功能</title>
	<script>
		var arr1=[1,2,3,4,5];
		var arr2=[1,2,3,7,8];
		function getpoor(arr1,arr2){
            var arr=[];
			for(var i=0;i<arr1.length;i++){
				if (arr1.indexOf(arr2[i])==-1) {
					arr.push(arr2[i]);
				}
				if(arr2.indexOf(arr1[i])==-1){
					arr.push(arr1[i]);
				}
			}
			return arr;
		}
		var a= getpoor(arr1,arr2);
		console.log(a);
		
	</script>
</head>
<body>
	
</body>
</html>